<style>
.reader_content {position:fixed; top:72px; left:11%; right:11%; bottom:20px; padding:10px; font-size:14px; line-height:150%; background-color:#FFF; overflow:auto;}
.mbtn_y {padding:2px 10px; font-size:12px; background-color:#FA6; color:#FFF;}
.mbtn_b {padding:2px 10px; font-size:12px; background-color:#ACF; color:#FFF;}
.big_save {display:inline-block; cursor:pointer; background-color:#85A749; border:1px solid #666; padding:3px 15px 5px 15px; margin:0 20px; white-space:nowrap; color:#FFF; font-family:微软雅黑,黑体; font-size:20px;}
.big_button {width:80px; height:40px; white-space:nowrap; color:green; font-family:微软雅黑,黑体; font-size:20px;}
</style>

<div class="corner_all" style="position:fixed; top:10px; left:10%; right:10%; bottom:10px; background-color:#EEE; border:1px solid #CCC;">
	<table width="100%" cellpadding="10" cellspacing="0" border="0">
		<tr>
			<td nowrap>
				<{if $flag == 'uncheck' and $article.is_checked_by_admin == 0}>
					<button class="big_button" onclick="AR.set_to_pass(<{$article.id}>);">Pass</button>
				<{/if}>
				<{if $flag == 'hot'}>
					<button class="big_button" onclick="AR.set_un_hot(<{$article.id}>);">unHot</button>
				<{elseif $flag == 'uncheck' or $flag == 'checked'}>
					<button class="big_button" onclick="AR.set_to_hot(<{$article.id}>);">Hot</button>
				<{/if}>
			</td>
			<td>
				<span style="font-size:14px; word-break:break-all;"><{$article.title}></span>
				<span> ( <{$article.dt}> ) </span>
				<br>
				<a class="usr" href="<{$article.url}>" target="_blank"><{$article.url}></a>
			</td>
			<td align="right">
				<{if $flag == 'uncheck' or $flag == 'checked'}>
					<button class="big_button" onclick="AR.del(<{$article.id}>);" style="color:red;">Del</button>
				<{/if}>
			</td>
		</tr>
	</table>
	<div id="reader_content" class="reader_content corner_all">
		<iframe id="reader_iframe" width="100%" frameborder="0" height="100%" scrolling="auto" style="background-color:#FFF; padding:0; margin:0;" src="/a.php?reader_id=<{$article.id}>>&reader_type=<{$reader_type}>"></iframe>
	</div>
		<script type="text/javascript">
			var UM_EDITOR_P = new function () {
				this.edit = function () {
					document.getElementById('reader_iframe').contentWindow.edit();
					$('#title input').val(this.decodeHtml($('#title span').html()));
					$('#title span').hide();
					$('#title input').show();
					$('#btn_edit').hide();
					$('#btn_move').hide();
					$('#btn_del').hide();
					$('#big_save').hide();
					$('#btn_preview').show();
					$('#btn_save').show();
					$('#btn_msg').html('编辑中...').show();
				}
				this.preview = function () {
					document.getElementById('reader_iframe').contentWindow.preview();
					$('#btn_edit').show();
					$('#btn_preview').hide();
				}
				this.save = function () {
					document.getElementById('reader_iframe').contentWindow.preview();
					$('#btn_msg').html('正在保存...').show();
					$('#btn_preview').hide();
					$('#btn_save').hide();
					$('#btn_edit').show();
					
					var id			= '<{$article.content_id}>';
					var title 		= $('#title input').val();
					var content 	= document.getElementById('reader_iframe').contentDocument.getElementById('content').innerHTML;
					if (id && title && content) {
						title 	= encodeURIComponent(title);
						content = encodeURIComponent(content);
						loadMod('reader/action_edit', {'id':id, 'title':title, 'content':content}, '', function(msg){
							if (msg == 'true') {
								$('#btn_msg').html('保存完成！').delay(2000).fadeOut(1000, function(){$('#big_save').show();});
								$('#btn_edit').show();
								$('#btn_move').show();
								$('#btn_del').show();
								$('#btn_preview').hide();
								$('#btn_save').hide();
								$('#title input').hide();
								$('#title span').html($('#title input').val()).show();
							} else {
								$('#btn_msg').html('未能修改！').delay(2000).fadeOut(1000, function(){$('#big_save').show();});
								$('#btn_edit').show();
								$('#btn_move').show();
								$('#btn_del').show();
								$('#btn_preview').hide();
								$('#btn_save').hide();
								$('#title input').hide();
								$('#title span').show();
							}
						} );
					} else {
						$('#btn_msg').html('标题、正文不能为空！').show();
					}
				}
			}
		</script>
</div>